<template>
    <div>
        {{home + $route.params.id}}
    </div>
</template>
<script setup lang="ts">
const home = ref('is home')
const route = useRoute()
home.value = route.query.name as string
// 当访问/posts/1时，route.params.id将为1
console.log(route.params.id)
console.log(route.query.name)

</script>

<style scoped>

</style>